#include <iostream>
#include <list>
#include <map>
#include <vector>
using namespace std;
struct Node {
  int val;
  Node *left;
  Node *right;
  Node(int a) : val(a), left(nullptr), right(nullptr) {}
};
bool find_path(Node *root, Node *target, list<Node *> &res) {
  if (root == nullptr || target == nullptr)
    return false;
  if (root == target) {
    res.push_front(root);
    return true;
  }
  list<Node *> a;
  list<Node *> b;
  if (find_path(root->left, target, a)) {
    res = a;
    res.push_front(root);
    return true;
  } else if (find_path(root->right, target, b)) {
    res = b;
    res.push_front(root);
    return true;
  } else {
    return false;
  }
}

void proc2(Node *root, int k, list<Node *> &res) {
  if (k < 0)
    return;
}

bool proc(Node *root, Node *target, int k) {
  list<Node *> res;
  if (find_path(root, target, res)) {
    int temp = res.size();

  } else {
    return false;
  }
  return true;
}

int main(int argc, char *argv[]) { 
	Node a(1);
	Node b(3);
	return 0; }
